package com.hxzy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hxzy.common.dto.ChangeStatusDTO;
import com.hxzy.dto.EmployeeSearchDTO;
import com.hxzy.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * EmployeeMapper继承基类
 */
@Mapper
@Repository
public interface EmployeeMapper extends BaseMapper<Employee> {


    Employee selectByPrimaryKey(Long id);

    /**
     * 分页查询
     * @param dto
     * @return
     */
    List<Employee> search(@Param(value = "dto") EmployeeSearchDTO dto);

    /**
     * 更改账户状态
     * @param id
     * @param status
     * @return
     */
    @Update(value = "update employee set status=#{status} where id=#{id}")
    int updateStatus(@Param(value = "id") Long id, @Param(value = "status") Integer status);

    /**
     * 批量更新值
     * @param ids
     * @param status
     * @return
     */
    int updateStatusBatch(@Param(value = "ids") Long[] ids,@Param(value = "status") Integer status);


}